sql="select * from products where [type]=" & type_id & " order by id desc"

来源:百度知道 编辑:UC知道 时间:2024/06/23 16:12:35
sql="select * from products where [type]=" & type_id & " order by id desc"

假设表中的列type有值105,而我只需要除105以外的值,怎么写查询语句。
菜鸟谢谢高人
可这样以后
下面的
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
中的rs.open sql,conn,1,3
在运行后会提示:标准表达式中数据类型不匹配“
再次求助

sql="select * from products where [type]="&type_id&" and[type]<>105 order by id desc"
注意and前应该有个空格

sql="select * from products where [type]='" & type_id & "' and [type]<>'105' order by id desc"

这样写

sql="select * from products where [type]=" & type_id & " and [type]<>105 order by id desc"